﻿using System.Data.Entity;
using System.Linq;
using Seed.Model;

namespace Seed.Data
{
    public class DatabaseInitializer : DropCreateDatabaseAlways<EntityContext>
    {
        protected override void Seed(EntityContext context)
        {
            if (!context.People.Any())
            {
                context.People.Add(new Person {Name = "Claudia", Age = 24});
                context.People.Add(new Person {Name = "Juan C. Yamacho", Age = 25});
                context.SaveChanges();    
            }
        }
        
    }
}